﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


using NUnit.Framework;
using OAPlatform.CommonHelper;

namespace OAPlatform.Test.Common
{
    [TestFixture]
    class TestExtension
    {
        [Test]
        public void TestFormatWith()
        {
            string formatString = "a is {0},b is {1}";
            Assert.AreEqual(string.Format(formatString, "a", "b"), formatString.FormatWith("a", "b"));
            Assert.Throws(typeof(System.FormatException), () => formatString.FormatWith("a"));
            Assert.AreEqual(string.Format(formatString, "a", "b"), formatString.FormatWith("a", "b", "c"));
            Assert.AreEqual(string.Format(formatString, "a", "b"), formatString.FormatWith("a", "b", "c", "d"));
        }
    }
}
